package com.clz.controller;


import com.clz.entity.User;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.servlet.ModelAndView;

import javax.servlet.http.HttpSession;

@Controller
public class HelloController  {
    @RequestMapping("/hi")
    public ModelAndView hello(HttpSession session){
        ModelAndView mv =new ModelAndView();
        mv.setViewName("hello");
        User user= (User) session.getAttribute("user");
        mv.addObject("user", user);
        mv.addObject("msg", "哈喽");
        return mv;
    }

}
